package com.hethongviet.preventingmachine;

import android.app.Application;

/** The application class */
public class AppMain extends Application
{
	private static AppMain instance = null;

	private Settings settings = null;

	public static AppMain getInstance()
	{
		if (instance == null)
			instance = new AppMain();
		return instance;
	}

	public AppMain()
	{
		try
		{
			Class<?> classInit = Class.forName("com.hethongviet.preventer.config.Init");
			settings = (Settings) classInit.newInstance();

			Utils.debug(settings.getDatabaseName());
		} catch (ClassNotFoundException e)
		{
			e.printStackTrace();
			settings = new Settings();
		} catch (InstantiationException e)
		{
			e.printStackTrace();
			settings = new Settings();
		} catch (IllegalAccessException e)
		{
			e.printStackTrace();
			settings = new Settings();
		}
	}

	public String getDBName()
	{
		return settings.getDatabaseName();
	}
}
